In semiconductor devices on which CPUs, such as micro controller units (MCUs), are mounted, debugging systems are used at the time of developing programs to be executed by the CPUs. Such a debugging system displays information on the operation of a CPU that executes a program being developed, and provides functions for carrying out specific operations of the program being developed so as to support debugging operations.
Various kinds of execution history information (trace information), which represents the operation history of a CPU configured to execute programs, include branch trace information, which represents the histories of branch executions, and data trace information, which represents the history of executing data accesses. In execution of a program by the CPU, a plurality of events that produce these kinds of trace information may occur simultaneously. For example, it is conceivable that one instruction in an instruction sequence included in a program is both an instruction for a branch destination and an instruction for a branch source that further specifies a branch from the branch destination. It is also conceivable, for example, that read data (part of data trace information) for a read access instruction that has been executed is supplied from a memory to the CPU at the same time as executions of a branch instruction and a data access instruction. In such cases where a plurality of events occurs at the same time, it is preferable that, during recording of trace information, all information to be recorded be recorded without any loss. It is also preferable that trace information handled in a debugging system be data in a format that is easy for a user to understand even when a plurality of events are complicated or occur at the same time during execution of a program. That is, even with complication or simultaneous occurrence of a plurality of events during execution of a program, it is preferable that trace information be produced in a data format arranged for each branch execution and for each data access execution. Thus, in a debugging system, trace information is allowed to be presented to a user in a form easy to understand.
Accordingly, a tracing method is desired that records all information to be recorded without any loss, and that produces trace information in a data format arranged for each branch execution and for each data access execution.